package com.hy.utils;


import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 *
 * @Description: 数据库管理器
 * @Author: zzw
 * @Date: 2024-04-08 17:32
 *
 *
 */
public class DBManager {

    private static final String URL = "jdbc:mysql://localhost:3306/automobile_sales_module?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8";
    private static final String USER = "root";
    private static final String PASSWORD = "root";

    public static Connection getConnection() throws Exception {
        Class.forName("com.mysql.cj.jdbc.Driver");
        Connection connection = DriverManager.getConnection(URL, USER, PASSWORD);
        return connection;
    }

    public static void main(String[] args) throws Exception {
        System.out.println(DBManager.getConnection());
    }
}
